Bug 573069 – Gdk-CRITICAL warnings with Gtk 2.14 when dragging
authorMatthias Clasen <matthiasc@src.gnome.org>
Sat, 28 Feb 2009 05:24:07 +0000 (05:24 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 28 Feb 2009 05:24:07 +0000 (05:24 +0000)
        GtkNotebook tabs

        * gtk/gtkwidget.c (_gtk_widget_synthesize_crossing): Be a little
        more careful when navigating up the parent chain.

        * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Reset the
        pointer window thats stored on the screen when it is destroyed.

svn path=/trunk/; revision=22420

ChangeLog
gdk/gdkwindow.c
gtk/gtkwidget.c

index fbcc030377c5bbc4d25f0286cc8f3abdf5df8fc3..06f21f81e635300b70fd7f71312e73dfbc14d9d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-28  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 573069 – Gdk-CRITICAL warnings with Gtk 2.14 when dragging
+       GtkNotebook tabs
+
+       * gtk/gtkwidget.c (_gtk_widget_synthesize_crossing): Be a little
+       more careful when navigating up the parent chain.
+
+       * gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Reset the
+       pointer window thats stored on the screen when it is destroyed.
+
 2009-02-27  Matthias Clasen  <mclasen@redhat.com>
 
        Bug 572996 – crash in Home Folder: Trying to open the sidebar
index a7cd74ce7f48df03774c9fc15bed54d0d4e44972..d7e0e685e1431d7d87a960242087925b35695386 100644 (file)
@@ -283,6 +283,8 @@ gdk_window_init (GdkWindowObject *window)
   window->state = GDK_WINDOW_STATE_WITHDRAWN;
 }
 
+static GQuark quark_pointer_window = 0;
+
 static void
 gdk_window_class_init (GdkWindowObjectClass *klass)
 {
@@ -319,6 +321,8 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->get_clip_region = gdk_window_get_clip_region;
   drawable_class->get_visible_region = gdk_window_get_visible_region;
   drawable_class->get_composite_drawable = gdk_window_get_composite_drawable;
+
+  quark_pointer_window = g_quark_from_static_string ("gtk-pointer-window");
 }
 
 static void
@@ -490,10 +494,14 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
   if (GDK_WINDOW_DESTROYED (window))
     return;
     
+  screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
+  temp_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window);
+  if (temp_window == window)
+    g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, NULL);
+
   switch (GDK_WINDOW_TYPE (window))
     {
     case GDK_WINDOW_ROOT:
-      screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
       if (!screen->closed)
        {
          g_error ("attempted to destroy root window");
@@ -2108,17 +2116,16 @@ gdk_window_clear_backing_rect_redirect (GdkWindow *window,
   if (GDK_WINDOW_DESTROYED (window))
     return;
 
-  paint.x_offset = x_offset;
-  paint.y_offset = y_offset;
-  paint.pixmap = redirect->pixmap;
-  paint.surface = _gdk_drawable_ref_cairo_surface (redirect->pixmap);
-  
   clip_region = _gdk_window_calculate_full_clip_region (window,
                                                        GDK_WINDOW (redirect->redirected),
                                                        NULL, TRUE,
                                                        &x_offset, &y_offset);
   
-
+  paint.x_offset = x_offset;
+  paint.y_offset = y_offset;
+  paint.pixmap = redirect->pixmap;
+  paint.surface = _gdk_drawable_ref_cairo_surface (redirect->pixmap);
+  
   method.cr = NULL;
   method.gc = NULL;
   setup_backing_rect_method (&method, window, &paint, 0, 0);
index 25c8620b100c66fac88ea25e0b65e48fed08d5eb..e85d9f1f7bb79e6a11e88e4fd0a08d7056d9a5d5 100644 (file)
@@ -8246,13 +8246,10 @@ _gtk_widget_synthesize_crossing (GtkWidget      *from,
 
       while (from_ancestor != NULL)
        {
-         if (from_ancestor != NULL)
-           {
-             from_ancestor = gdk_window_get_parent (from_ancestor);
-             if (from_ancestor == NULL)
-               break;
-             from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
-           }
+         from_ancestor = gdk_window_get_parent (from_ancestor);
+          if (from_ancestor == NULL)
+            break;
+          from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
        }
 
       synth_crossing (from, GDK_LEAVE_NOTIFY, from_window,
@@ -8274,14 +8271,11 @@ _gtk_widget_synthesize_crossing (GtkWidget      *from,
 
       while (to_ancestor != NULL)
        {
-         if (to_ancestor != NULL)
-           {
-             to_ancestor = gdk_window_get_parent (to_ancestor);
-             if (to_ancestor == NULL)
-               break;
-             to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
-           }
-       }
+         to_ancestor = gdk_window_get_parent (to_ancestor);
+         if (to_ancestor == NULL)
+            break;
+          to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
+        }
 
       /* XXX: leave/inferior on root window? */
 
@@ -8309,14 +8303,16 @@ _gtk_widget_synthesize_crossing (GtkWidget      *from,
              from_ancestor = gdk_window_get_parent (from_ancestor);
              if (from_ancestor == to_window)
                break;
-             from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
+              if (from_ancestor)
+               from_ancestors = g_list_prepend (from_ancestors, from_ancestor);
            }
          if (to_ancestor != NULL)
            {
              to_ancestor = gdk_window_get_parent (to_ancestor);
              if (to_ancestor == from_window)
                break;
-             to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
+              if (to_ancestor)
+               to_ancestors = g_list_prepend (to_ancestors, to_ancestor);
            }
        }
       if (to_ancestor == from_window)